//
//  SYViewController.m
//  Vpay
//
//  Created by 伟大大 on 2018/9/15.
//  Copyright © 2018年 丁伟佳. All rights reserved.
//

#import "SYViewController.h"
#import "LXWebViewController.h"
#import "NewWebViewController.h"
#import "ScanQRCodeViewController.h"
#import "ZRViewController.h"
#import "ZCViewController.h"
#import "SZZCViewController.h"
#import "SetViewController.h"
#import "LoginViewController.h"



@interface SYViewController () {
    adScrollView *adSV;
}

@end

@implementation SYViewController

#pragma mark -
#pragma mark - for lifeCircle
#pragma mark -
- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];

    [NSThread detachNewThreadSelector:@selector(requestPersonData) toTarget:self withObject:nil];

    
    [self.navigationController setNavigationBarHidden:YES animated:animated];

}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    
//    [self.navigationController setNavigationBarHidden:NO animated:NO];
    
    //    [self.navigationController setNavigationBarHidden:YES animated:NO];
    
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    self.view.backgroundColor = BACKCOLOR;
    
    [self.navigationController setNavigationBarHidden:YES animated:NO];
    
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];
//    [self.navigationController setNavigationBarHidden:NO animated:NO];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view = [[[NSBundle mainBundle]loadNibNamed:@"SYViewController" owner:self options:nil]lastObject];
    self.view.backgroundColor = BACKCOLOR;
    
    
  
    [self initData];
    
    [NSThread detachNewThreadSelector:@selector(requestData) toTarget:self withObject:nil];
    [NSThread detachNewThreadSelector:@selector(requestPersonData) toTarget:self withObject:nil];

    [self initViews];
    [self initADSVView];
    

}
#pragma mark -
#pragma mark - for data
#pragma mark -
- (void)initData {
    myArray = [NSMutableArray array];
}
#pragma mark -
#pragma mark - for Views
#pragma mark -
- (void)initViews {
    
//    [self.PersonimageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",userDic[@"uinfo"][@"img_head"]]] placeholderImage:[AppUtility getLocalImage:@"image_Listmr"]];

    self.Topxy_label.text = NSLocalizedString(@"xy", nil);
    self.SMZF_label.text = NSLocalizedString(@"smzf", nil);
    [self.ZC_btn setTitle:NSLocalizedString(@"zc", nil) forState:UIControlStateNormal];
    [self.ZR_btn setTitle:NSLocalizedString(@"zr", nil) forState:UIControlStateNormal];
    [self.DH_btn setTitle:NSLocalizedString(@"dh", nil) forState:UIControlStateNormal];
    [self.ZhongChou_btn setTitle:NSLocalizedString(@"zhongchou", nil) forState:UIControlStateNormal];
    [self.SZZC_btn setTitle:NSLocalizedString(@"szzc", nil) forState:UIControlStateNormal];
    [self.shop_btn setTitle:NSLocalizedString(@"sc", nil) forState:UIControlStateNormal];
    [self.VGY_btn setTitle:NSLocalizedString(@"Vgy", nil) forState:UIControlStateNormal];
    [self.VDai_btn setTitle:NSLocalizedString(@"Vdai", nil) forState:UIControlStateNormal];
    [self.VXY_btn setTitle:NSLocalizedString(@"Vxy", nil) forState:UIControlStateNormal];

    
//    [self.JF_btn setTitle:[NSString stringWithFormat:@"%@\n\n%@",NSLocalizedString(@"jf", nil),userDic[@"moneyinfo"][@"cangku_num"]] forState:UIControlStateNormal];
    self.JF_btn.titleLabel.lineBreakMode = 0;
    self.JF_btn.titleLabel.textAlignment = NSTextAlignmentCenter;
    
//    [self.YE_btn setTitle:[NSString stringWithFormat:@"%@\n\n%@",NSLocalizedString(@"ye", nil),userDic[@"moneyinfo"][@"fengmi_num"]] forState:UIControlStateNormal];
    self.YE_btn.titleLabel.lineBreakMode = 0;
    self.YE_btn.titleLabel.textAlignment = NSTextAlignmentCenter;
    
    self.ZC_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX, 25*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX);
    self.ZC_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -32*theApp.autoSizeScaleX, 0, 0);
    
    self.ZR_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX, 25*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX);
    self.ZR_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -31*theApp.autoSizeScaleX, 0, 0);
    
    self.ZhongChou_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 40*theApp.autoSizeScaleX, 28*theApp.autoSizeScaleY, 40*theApp.autoSizeScaleX);
    self.ZhongChou_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -30*theApp.autoSizeScaleX, 0, 0);
    
    self.SZZC_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX, 25*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX);
    self.SZZC_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -26*theApp.autoSizeScaleX, 0, 0);
    
    self.shop_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX, 25*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX);
    self.shop_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -26*theApp.autoSizeScaleX, 0, 0);
    
    self.DH_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 40*theApp.autoSizeScaleX, 28*theApp.autoSizeScaleY, 40*theApp.autoSizeScaleX);
    self.DH_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -26*theApp.autoSizeScaleX, 0, 0);
    
    self.VGY_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 38*theApp.autoSizeScaleX, 23*theApp.autoSizeScaleY, 38*theApp.autoSizeScaleX);
    self.VGY_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -36*theApp.autoSizeScaleX, 0, 0);
    
    self.VDai_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX, 33*theApp.autoSizeScaleY, 38.5*theApp.autoSizeScaleX);
    self.VDai_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -26*theApp.autoSizeScaleX, 0, 0);
    
    self.VXY_btn.imageEdgeInsets = UIEdgeInsetsMake(7*theApp.autoSizeScaleY, 38*theApp.autoSizeScaleX, 27*theApp.autoSizeScaleY, 38*theApp.autoSizeScaleX);
    self.VXY_btn.titleEdgeInsets = UIEdgeInsetsMake(38*theApp.autoSizeScaleY, -36*theApp.autoSizeScaleX, 0, 0);
    
    
    self.PersonimageView.layer.masksToBounds = YES;
    self.PersonimageView.layer.cornerRadius = self.PersonimageView.frame.size.width/2;
    
    self.PersonimageView.userInteractionEnabled = YES;

    UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
    //    tap.delegate = self;
    [self.PersonimageView addGestureRecognizer:tap1];
    
    UITapGestureRecognizer *tap2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction2)];
    //    tap.delegate = self;
    [self.CRYEimageView addGestureRecognizer:tap2];
    
//    [self.BtnView setFrame:CGRectMake(0, self.MidView.frame.origin.y+self.MidView.frame.size.height, self.BtnView.frame.size.width, self.BtnView.frame.size.height)];

    
}
- (void)initADSVView {
    
    adSV = [[adScrollView alloc]initWithFrame:CGRectMake(0, 0, [AppUtility screenWidth], 70*theApp.autoSizeScaleY) ImageArrays:nil typeArrays:nil titleDictionary:nil pageConFrame:CGRectMake(110*theApp.autoSizeScaleX, 55*theApp.autoSizeScaleY, 100*theApp.autoSizeScaleX, 15*theApp.autoSizeScaleY) isTime:YES PageColor:BLUECOLOR];
    adSV.ADelegate = self;
    adSV.backgroundColor = TITLECOLOR;
    [self.MidView addSubview:adSV];
    
    [self performSelectorOnMainThread:@selector(ToUpDataForHome) withObject:nil waitUntilDone:NO];
}
-(void)requestData
{
    
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@",KURLLunbo] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLLunbo,resultDict_hot);
    
    if ([[resultDict_hot objectForKey:@"s"] intValue]==1) {
        
        [myArray removeAllObjects];
        
        [myArray addObjectsFromArray:[resultDict_hot objectForKey:@"d"]];
        
    }else if ([[resultDict_hot objectForKey:@"s"] intValue]==303) {
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        return;
    }
    
    [self performSelectorOnMainThread:@selector(ToUpDataForHome) withObject:nil waitUntilDone:NO];
    
}
-(void)requestPersonData
{
    
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([[resultDict_hot objectForKey:@"s"] intValue]==1) {
        
        [userDic removeAllObjects];
        
//        [myArray addObjectsFromArray:[resultDict_hot objectForKey:@"d"]];
        userDic = [[NSMutableDictionary alloc]initWithDictionary:[resultDict_hot objectForKey:@"d"]];

    }else if ([[resultDict_hot objectForKey:@"s"] intValue]==303) {
        
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        return;
    }
    
    [self performSelectorOnMainThread:@selector(RefreshView) withObject:nil waitUntilDone:NO];
    
}
-(void)requestPersonData1
{
    
    
}
-(void)ToUpDataForHome
{
    
    NSMutableArray *imgaeArray = [[NSMutableArray alloc]init];
    
    NSMutableArray *typeArray = [[NSMutableArray alloc]init];
    for (int i =0; i<myArray.count; i++) {
        
        [imgaeArray addObject:[NSString stringWithFormat:@"%@",[[myArray objectAtIndex:i] objectForKey:@"picture"]]];
        [typeArray addObject:[NSString stringWithFormat:@"%d",i+1]];
    }
    
    
    [adSV adScrollViewChangeImageArrys:imgaeArray TypeArrays:typeArray titleArrays:nil];
}
- (void)viewTappedwithAdScrollView:(UIView *)view Type:(long)type
{
    
    
}
- (void)tapAction {
    SetViewController *vc = [[SetViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
- (void)tapAction2 {
    
    NSString *postStr = [NSString stringWithFormat:@"userid=%@&isApp=1&can_get=%@",@"",userDic[@"can_get"]];
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:KURLUserInfo andPostStr:postStr];
    
    UEXNSLog(@"URL = %@%@ ,resultDict_hot=%@",KURLUserInfo,postStr,resultDict_hot);
    
    if ([[resultDict_hot objectForKey:@"s"] intValue]==1) {
        
        [userDic removeAllObjects];
        
        //        [myArray addObjectsFromArray:[resultDict_hot objectForKey:@"d"]];
        userDic = [[NSMutableDictionary alloc]initWithDictionary:[resultDict_hot objectForKey:@"d"]];
        
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];

    }else if ([[resultDict_hot objectForKey:@"s"] intValue]==303) {
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        return;
    }
    
    [self performSelectorOnMainThread:@selector(RefreshView66) withObject:nil waitUntilDone:NO];
}
- (void)RefreshView66 {
    
    _HBView.hidden = YES;

    [self.YE_btn setTitle:[NSString stringWithFormat:@"%@\n\n%@",NSLocalizedString(@"ye", nil),userDic[@"moneyinfo"][@"cangku_num"]] forState:UIControlStateNormal];
    [self.JF_btn setTitle:[NSString stringWithFormat:@"%@\n\n%@",NSLocalizedString(@"jf", nil),userDic[@"moneyinfo"][@"fengmi_num"]] forState:UIControlStateNormal];
}
    


- (void)RefreshView {
    SLog(@"uid=%@",userDic[@"uinfo"][@"userid"]);
    SLog(@"iamge=%@",userDic[@"uinfo"][@"img_head"]);

    if ([userDic[@"can_get"] intValue]>0) {
        _HBView.hidden = NO;
        self.Canget_label.text = [NSString stringWithFormat:@"%@元",userDic[@"can_get"]];

    }else {
        _HBView.hidden = YES;

    }
    self.UID_label.text = [NSString stringWithFormat:@"UID：%@",userDic[@"uinfo"][@"userid"]];
    
    [self.JF_btn setTitle:[NSString stringWithFormat:@"%@\n\n%@",NSLocalizedString(@"jf", nil),userDic[@"moneyinfo"][@"fengmi_num"]] forState:UIControlStateNormal];
    [self.YE_btn setTitle:[NSString stringWithFormat:@"%@\n\n%@",NSLocalizedString(@"ye", nil),userDic[@"moneyinfo"][@"cangku_num"]] forState:UIControlStateNormal];

//    NSString *imageStr = [NSString stringWithFormat:@"%@",userDic[@"uinfo"][@"img_head"]];
//    dispatch_queue_t globalQueue = dispatch_get_global_queue(0, 0);
//
//    dispatch_async(globalQueue, ^{
//
//        NSString *urlString = imageStr;
//        NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
//        UIImage *image = [UIImage imageWithData:data]; // 取得图片
//        // 本地沙盒目录
//        NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
//        // 得到本地沙盒中名为"MyImage"的路径，"MyImage"是保存的图片名
//        NSString *imageFilePath = [path stringByAppendingPathComponent:@"MyImage"]; // 将取得的图片写入本地的沙盒中，其中0.5表示压缩比例，1表示不压缩，数值越小压缩比例越大
//        BOOL success = [UIImageJPEGRepresentation(image, 0.5) writeToFile:imageFilePath atomically:YES];
//        if (success){
//            NSLog(@"写入本地成功");
//
//        }
//
//        [self.PersonimageView setImage:[UIImage imageWithContentsOfFile:imageFilePath]];
//
//    });
    
    
   
    [self.PersonimageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",userDic[@"uinfo"][@"img_head"]]] placeholderImage:[AppUtility getLocalImage:@"image_Listmr"]];
    
    if ([userDic[@"uinfo"][@"user_credit"] isEqualToString:@"1"]) {
        self.XY_imageView1.hidden = NO;
        self.XY_imageView2.hidden = YES;
        self.XY_imageView3.hidden = YES;
        self.XY_imageView4.hidden = YES;
        self.XY_imageView5.hidden = YES;
    }else if ([userDic[@"uinfo"][@"user_credit"] isEqualToString:@"2"]) {
        self.XY_imageView1.hidden = NO;
        self.XY_imageView2.hidden = NO;
        self.XY_imageView3.hidden = YES;
        self.XY_imageView4.hidden = YES;
        self.XY_imageView5.hidden = YES;
    }else if ([userDic[@"uinfo"][@"user_credit"] isEqualToString:@"3"]) {
        self.XY_imageView1.hidden = NO;
        self.XY_imageView2.hidden = NO;
        self.XY_imageView3.hidden = NO;
        self.XY_imageView4.hidden = YES;
        self.XY_imageView5.hidden = YES;
    }else if ([userDic[@"uinfo"][@"user_credit"] isEqualToString:@"4"]) {
        self.XY_imageView1.hidden = NO;
        self.XY_imageView2.hidden = NO;
        self.XY_imageView3.hidden = NO;
        self.XY_imageView4.hidden = NO;
        self.XY_imageView5.hidden = YES;
    }else if ([userDic[@"uinfo"][@"user_credit"] isEqualToString:@"5"]) {
        self.XY_imageView1.hidden = NO;
        self.XY_imageView2.hidden = NO;
        self.XY_imageView3.hidden = NO;
        self.XY_imageView4.hidden = NO;
        self.XY_imageView5.hidden = NO;
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/


- (IBAction)SM_btnClik:(UIButton *)sender {
    
    ScanQRCodeViewController *scanQRCodeVC = [[ScanQRCodeViewController alloc] initWithNibName:@"ScanQRCodeViewController" bundle:nil];
    [self.navigationController pushViewController:scanQRCodeVC animated:YES];
}

- (IBAction)Set_btnClik:(UIButton *)sender {
    SetViewController *vc = [[SetViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)JF_btnClik:(UIButton *)sender {
    
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([resultDict_hot[@"s"] intValue] == 303) {
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWNO];
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWPass];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
        return;
        
    }
    
    
    LXWebViewController *vc = [[LXWebViewController alloc]init];
    vc.LXtitle = @"积分记录";
    vc.urlStr = @"http://vpay1.luck8868.com/Index/Exchangerecords.html";
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)YE_btnClik:(UIButton *)sender {
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([resultDict_hot[@"s"] intValue] == 303) {
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWNO];
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWPass];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
        return;
        
    }
    LXWebViewController *vc = [[LXWebViewController alloc]init];
    vc.LXtitle = @"余额记录";
    vc.urlStr = @"http://vpay1.luck8868.com/Index/Bancerecord.html";
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)ZC_btnClik:(UIButton *)sender {
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([resultDict_hot[@"s"] intValue] == 303) {
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWNO];
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWPass];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
        return;
        
    }
    LXWebViewController *vc = [[LXWebViewController alloc]init];
    vc.LXtitle = @"转出";
    vc.mytype = @"zc";
    vc.urlStr = @"http://vpay1.luck8868.com/Index/turnout.html";
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)ZR_btnClik:(UIButton *)sender {
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([resultDict_hot[@"s"] intValue] == 303) {
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWNO];
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWPass];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
        return;
        
    }
    LXWebViewController *vc = [[LXWebViewController alloc]init];
    vc.LXtitle = @"转入";
    vc.mytype = @"zr";
    vc.urlStr = @"http://vpay1.luck8868.com/Growth/Intro.html";
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)DH_btnClik:(UIButton *)sender {
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([resultDict_hot[@"s"] intValue] == 303) {
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWNO];
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWPass];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
        return;
        
    }
    LXWebViewController *vc = [[LXWebViewController alloc]init];
    vc.LXtitle = @"VS宝数字中心";
//    vc.mytype = @"dh";
    vc.urlStr = @"http://vpay1.luck8868.com/Turntable/Wbaobei.html";
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)ZhongChou_btnClik:(UIButton *)sender {
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([resultDict_hot[@"s"] intValue] == 303) {
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWNO];
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWPass];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
        return;
        
    }
    LXWebViewController *vc = [[LXWebViewController alloc]init];
    vc.LXtitle = @"众筹项目中心";
    vc.mytype = @"zhongchou";

    vc.urlStr = @"http://vpay1.luck8868.com/Turntable/Crowds.html";
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)SZZC_btnClik:(UIButton *)sender {
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([resultDict_hot[@"s"] intValue] == 303) {
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWNO];
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWPass];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
        return;
        
    }
    LXWebViewController *vc = [[LXWebViewController alloc]init];
    vc.LXtitle = @"数字资产";
    vc.mytype = @"szzc";
    vc.urlStr = @"http://vpay1.luck8868.com/Turntable/index.html";
    [self.navigationController pushViewController:vc animated:YES];
    
    

}
- (IBAction)shop_btnClik:(UIButton *)sender {
    NSDictionary *resultDict_hot =[NetUtility getDataWithURLStr:[NSString stringWithFormat:@"%@userid=%@&isApp=1",KURLUserInfo,@""] andPostStr:nil];
    
    UEXNSLog(@"URL = %@ ,resultDict_hot=%@",KURLUserInfo,resultDict_hot);
    
    if ([resultDict_hot[@"s"] intValue] == 303) {
        [self.navigationController.view makeToast:resultDict_hot[@"i"]];
        
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWNO];
        [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUDAppTDWPass];
        
        LoginViewController *vc = [[LoginViewController alloc]init];
        [self.navigationController pushViewController:vc animated:YES];
        
        return;
        
    }
    LXWebViewController *vc = [[LXWebViewController alloc]init];
//    vc.LXtitle = @"众筹项目中心";
    vc.urlStr = @"http://vpay1.luck8868.com/Shop/Home/mend/sta/4.html";
    [self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)VGY_btnClik:(UIButton *)sender {
    
    UIAlertView *aaa = [[UIAlertView alloc]initWithTitle:@"此功能暂未开放，敬请期待" message:@"" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    
    [aaa showWithCompletionHandler:^(NSInteger buttonIndex) {
        
        if (buttonIndex==0) {
            
            
        }
        else
        {
            
        }
    }];
}
- (IBAction)VDai_btnClik:(UIButton *)sender {
    UIAlertView *aaa = [[UIAlertView alloc]initWithTitle:@"此功能暂未开放，敬请期待" message:@"" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    
    [aaa showWithCompletionHandler:^(NSInteger buttonIndex) {
        
        if (buttonIndex==0) {
            
            
        }
        else
        {
            
        }
    }];
}
- (IBAction)VXY_btnClik:(UIButton *)sender {
    UIAlertView *aaa = [[UIAlertView alloc]initWithTitle:@"此功能暂未开放，敬请期待" message:@"" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    
    [aaa showWithCompletionHandler:^(NSInteger buttonIndex) {
        
        if (buttonIndex==0) {
            
            
        }
        else
        {
            
        }
    }];
}
@end
